import { WebView, View, Text, Image } from '@tarojs/components';
import React, { Component } from 'react';
import Taro, { getCurrentInstance } from '@tarojs/taro';
import { connect } from 'react-redux';
import './index.less';
import * as T from './types';
import actions from './actions';
import { store2Props } from './selectors';

actions().actions.loadReducer();
// @ts-ignore
@connect<Partial<T.IProps>, any>(store2Props, actions)
export default class Index extends Component<Partial<T.IProps>, any> {
  constructor(props) {
    super(props);
    this.state = {};
  }

  componentDidMount() { }

  componentDidShow() { }

  componentWillUnmount() { }

  onLoad(e) {
    console.log('---authentication-----onLoad')
    console.log(e)
  }

  onError(e) {
    console.log('---authentication-----onError')
    console.log(e)
  }

  onMessage(e) {
    console.log('---authentication-----onMessage')
    console.log(e)
  }

  render() {
    return (
      <View>
        <WebView src='http://114.67.125.212:8899/jbservice/H5/authentication.html' onError={this.onError} onLoad={this.onLoad} onMessage={this.onMessage} />
      </View>
    );
  }
}
